﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace calculator_zhongduan
{
    
    
    
        static class Program
        {
            /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            [STAThread]
            static void Main()
            {
                int num1 = 0;
                int num2 = 0;
                Console.WriteLine(" 请输入第一个数字： ");
                num1 = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine(" 然后输入第二个数字: ");
                num2 = Convert.ToInt32(Console.ReadLine());
                //Console.Write($"num1:{num1},num2:{num2}");
                Console.WriteLine(" 请选择你说想要进行的操作:");
                Console.WriteLine(" +  \t -  \t *  \t /");
                Console.Write("嘿嘿   ");
                switch (Console.ReadLine())
                {
                    case "+":
                        Console.WriteLine($"{num1}+{num2}={num1 + num2}");
                        break;
                    case "-":
                        Console.WriteLine($"{num1}-{num2}={num1 - num2}");
                        break;
                    case "*":
                        Console.WriteLine($"{num1}*{num2}={num1 * num2}");
                        break;
                    case "/":
                        if (num2 == 0) Console.WriteLine("错误 除数不能为0");
                        else
                            Console.WriteLine($"{num1}/{num2}={num1 / num2}");
                        break;
                    default:
                        Console.WriteLine("请输入正确操作");
                        break;
                }

                Console.Read();

            }
        }
    }

